<?php
include "simple_html_dom.php";

function download($host, $path)
{
    $data ="";
    $url = $host.$path;
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}




$string = download("www.wetteronline.de","/include/radar_dldl_00_dnrwf.htm");
$html = str_get_html($string);

$bild="";
// Find all article blocks
foreach($html->find('a[target=WOcontent]') as $article) {

    if ($article->plaintext == "Loop 90 Minuten")
    {
    	$bild = $article->href;
    }
    //echo $item[$i]  . "&nbsp;" . $i  . "<hr>";
}
$bild = substr($bild,48);
$bild = substr($bild,0,-8);


$jahr =substr($bild,4,4);

$monat =substr($bild,8,2);

$tag=substr($bild,10,2);

$zeit=substr($bild,12,4);
header("Location: http://www.wetteronline.de/daten/radar/dnrw/".$jahr."/".$monat."/".$tag."/std_".$zeit.".gif"');
?>